﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;

namespace Admin.NET.Application;

/// <summary>
/// 审批流程基础输入参数
/// </summary>
public class StoreProcessFlowStepBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 审批类型
    /// </summary>
    [Required(ErrorMessage = "审批类型不能为空")]
    public virtual string FlowType { get; set; }
    
    /// <summary>
    /// 申请批次
    /// </summary>
    public virtual string? BatchNo { get; set; }
    
    /// <summary>
    /// 申请号
    /// </summary>
    [Required(ErrorMessage = "申请号不能为空")]
    public virtual string RequestNo { get; set; }
    
    /// <summary>
    /// 分类Id
    /// </summary>
    public virtual long? StoreTypeId { get; set; }
    
    /// <summary>
    /// 分类名称
    /// </summary>
    public virtual string? StoreTypeName { get; set; }
    
    /// <summary>
    /// 物资Id
    /// </summary>
    public virtual long? MaterialId { get; set; }
    
    /// <summary>
    /// 物资名称
    /// </summary>
    public virtual string? MaterialName { get; set; }
    
    /// <summary>
    /// 物资单价
    /// </summary>
    public virtual decimal? MaterialPrice { get; set; }
    
    /// <summary>
    /// 申请数量
    /// </summary>
    public virtual decimal? Quantity { get; set; }
    
    /// <summary>
    /// 单位
    /// </summary>
    public virtual string? Unit { get; set; }
    
    /// <summary>
    /// 物资总价
    /// </summary>
    public virtual decimal? MaterialPriceTotal { get; set; }
    
    /// <summary>
    /// 申请人ID
    /// </summary>
    [Required(ErrorMessage = "申请人ID不能为空")]
    public virtual long? ApplicantId { get; set; }
    
    /// <summary>
    /// 申请人姓名
    /// </summary>
    public virtual string? ApplicantName { get; set; }
    
    /// <summary>
    /// 申请人区域
    /// </summary>
    public virtual string? ApplicantDept { get; set; }
    
    /// <summary>
    /// 接收人Id
    /// </summary>
    public virtual long? ReceiverId { get; set; }
    
    /// <summary>
    /// 接收人姓名
    /// </summary>
    public virtual string? ReceiverName { get; set; }
    
    /// <summary>
    /// 接收人区域
    /// </summary>
    public virtual string? ReceiverDept { get; set; }
    
    /// <summary>
    /// 申请时间
    /// </summary>
    public virtual DateTime? RequestTime { get; set; }
    
    /// <summary>
    /// 预期时间
    /// </summary>
    public virtual DateTime? ExpectedDate { get; set; }
    
    /// <summary>
    /// 完成时间
    /// </summary>
    public virtual DateTime? CompletedTime { get; set; }
    
    /// <summary>
    /// 新增或更新
    /// </summary>
    [Dict(nameof(StatusNewOrChangeEnum), AllowNullValue=true)]
    [Required(ErrorMessage = "新增或更新不能为空")]
    public virtual StatusNewOrChangeEnum? StatusNewOrChange { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public virtual string? Remark { get; set; }
    
    /// <summary>
    /// 审批状态
    /// </summary>
    [Dict(nameof(StatusApprovalEnum), AllowNullValue=true)]
    [Required(ErrorMessage = "审批状态不能为空")]
    public virtual StatusApprovalEnum? ApprovalAction { get; set; }
    
    /// <summary>
    /// 确认负责人ID
    /// </summary>
    public virtual long? ConfirmerId { get; set; }
    
    /// <summary>
    /// 确认负责人姓名
    /// </summary>
    public virtual string? ConfirmerName { get; set; }
    
}

/// <summary>
/// 审批流程分页查询输入参数
/// </summary>
public class PageStoreProcessFlowStepInput : BasePageInput
{
    /// <summary>
    /// 审批类型
    /// </summary>
    public string FlowType { get; set; }
    
    /// <summary>
    /// 申请批次
    /// </summary>
    public string? BatchNo { get; set; }
    
    /// <summary>
    /// 申请号
    /// </summary>
    public string RequestNo { get; set; }
    
    /// <summary>
    /// 分类Id
    /// </summary>
    public long? StoreTypeId { get; set; }
    
    /// <summary>
    /// 分类名称
    /// </summary>
    public string? StoreTypeName { get; set; }
    
    /// <summary>
    /// 物资Id
    /// </summary>
    public long? MaterialId { get; set; }
    
    /// <summary>
    /// 物资名称
    /// </summary>
    public string? MaterialName { get; set; }
    
    /// <summary>
    /// 物资单价
    /// </summary>
    public decimal? MaterialPrice { get; set; }
    
    /// <summary>
    /// 申请数量
    /// </summary>
    public decimal? Quantity { get; set; }
    
    /// <summary>
    /// 单位
    /// </summary>
    public string? Unit { get; set; }
    
    /// <summary>
    /// 物资总价
    /// </summary>
    public decimal? MaterialPriceTotal { get; set; }
    
    /// <summary>
    /// 申请人ID
    /// </summary>
    public long? ApplicantId { get; set; }
    
    /// <summary>
    /// 申请人姓名
    /// </summary>
    public string? ApplicantName { get; set; }
    
    /// <summary>
    /// 申请人区域
    /// </summary>
    public string? ApplicantDept { get; set; }
    
    /// <summary>
    /// 接收人Id
    /// </summary>
    public long? ReceiverId { get; set; }
    
    /// <summary>
    /// 接收人姓名
    /// </summary>
    public string? ReceiverName { get; set; }
    
    /// <summary>
    /// 接收人区域
    /// </summary>
    public string? ReceiverDept { get; set; }
    
    /// <summary>
    /// 申请时间范围
    /// </summary>
     public DateTime?[] RequestTimeRange { get; set; }
    
    /// <summary>
    /// 预期时间范围
    /// </summary>
     public DateTime?[] ExpectedDateRange { get; set; }
    
    /// <summary>
    /// 完成时间范围
    /// </summary>
     public DateTime?[] CompletedTimeRange { get; set; }
    
    /// <summary>
    /// 新增或更新
    /// </summary>
    [Dict(nameof(StatusNewOrChangeEnum), AllowNullValue=true)]
    public StatusNewOrChangeEnum? StatusNewOrChange { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }
    
    /// <summary>
    /// 审批状态
    /// </summary>
    [Dict(nameof(StatusApprovalEnum), AllowNullValue=true)]
    public StatusApprovalEnum? ApprovalAction { get; set; }
    
    /// <summary>
    /// 确认负责人ID
    /// </summary>
    public long? ConfirmerId { get; set; }
    
    /// <summary>
    /// 确认负责人姓名
    /// </summary>
    public string? ConfirmerName { get; set; }
    
    /// <summary>
    /// 是否查询我的审批历史记录
    /// </summary>
    public bool MyApprovalHistory { get; set; }
    
    /// <summary>
    /// 当前用户ID（用于历史记录查询）
    /// </summary>
    public long? CurrentUserId { get; set; }

    /// <summary>
    /// 机构ID（区域筛选，包含该部门及下级）
    /// </summary>
    public long? OrgId { get; set; }

    /// <summary>
    /// 选中的ID列表（用于导出选中项）
    /// </summary>
    public List<string> SelectKeyList { get; set; }
    
    /// <summary>
    /// 是否包含已完成或已拒绝记录
    /// </summary>
    public bool IncludeArchived { get; set; }

}

/// <summary>
/// 审批流程增加输入参数
/// </summary>
public class AddStoreProcessFlowStepInput
{
    /// <summary>
    /// 审批类型
    /// </summary>
    [Required(ErrorMessage = "审批类型不能为空")]
    [MaxLength(255, ErrorMessage = "审批类型字符长度不能超过255")]
    public string FlowType { get; set; }
    
    /// <summary>
    /// 申请批次
    /// </summary>
    [MaxLength(255, ErrorMessage = "申请批次字符长度不能超过255")]
    public string? BatchNo { get; set; }
    
    /// <summary>
    /// 申请号
    /// </summary>
    [Required(ErrorMessage = "申请号不能为空")]
    [MaxLength(255, ErrorMessage = "申请号字符长度不能超过255")]
    public string RequestNo { get; set; }
    
    /// <summary>
    /// 分类Id
    /// </summary>
    public long? StoreTypeId { get; set; }
    
    /// <summary>
    /// 分类名称
    /// </summary>
    [MaxLength(128, ErrorMessage = "分类名称字符长度不能超过128")]
    public string? StoreTypeName { get; set; }
    
    /// <summary>
    /// 物资Id
    /// </summary>
    public long? MaterialId { get; set; }
    
    /// <summary>
    /// 物资名称
    /// </summary>
    [MaxLength(128, ErrorMessage = "物资名称字符长度不能超过128")]
    public string? MaterialName { get; set; }
    
    /// <summary>
    /// 物资单价
    /// </summary>
    public decimal? MaterialPrice { get; set; }
    
    /// <summary>
    /// 申请数量
    /// </summary>
    public decimal? Quantity { get; set; }
    
    /// <summary>
    /// 单位
    /// </summary>
    [MaxLength(32, ErrorMessage = "单位字符长度不能超过32")]
    public string? Unit { get; set; }
    
    /// <summary>
    /// 物资总价
    /// </summary>
    public decimal? MaterialPriceTotal { get; set; }
    
    /// <summary>
    /// 申请人ID
    /// </summary>
    [Required(ErrorMessage = "申请人ID不能为空")]
    public long? ApplicantId { get; set; }
    
    /// <summary>
    /// 申请人姓名
    /// </summary>
    [MaxLength(255, ErrorMessage = "申请人姓名字符长度不能超过255")]
    public string? ApplicantName { get; set; }
    
    /// <summary>
    /// 申请人区域
    /// </summary>
    [MaxLength(255, ErrorMessage = "申请人区域字符长度不能超过255")]
    public string? ApplicantDept { get; set; }
    
    /// <summary>
    /// 接收人Id
    /// </summary>
    public long? ReceiverId { get; set; }
    
    /// <summary>
    /// 接收人姓名
    /// </summary>
    [MaxLength(255, ErrorMessage = "接收人姓名字符长度不能超过255")]
    public string? ReceiverName { get; set; }
    
    /// <summary>
    /// 接收人区域
    /// </summary>
    [MaxLength(255, ErrorMessage = "接收人区域字符长度不能超过255")]
    public string? ReceiverDept { get; set; }
    
    /// <summary>
    /// 申请时间
    /// </summary>
    public DateTime? RequestTime { get; set; }
    
    /// <summary>
    /// 预期时间
    /// </summary>
    public DateTime? ExpectedDate { get; set; }
    
    /// <summary>
    /// 完成时间
    /// </summary>
    public DateTime? CompletedTime { get; set; }
    
    /// <summary>
    /// 新增或更新
    /// </summary>
    [Dict(nameof(StatusNewOrChangeEnum), AllowNullValue=true)]
    [Required(ErrorMessage = "新增或更新不能为空")]
    public StatusNewOrChangeEnum? StatusNewOrChange { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(128, ErrorMessage = "备注字符长度不能超过128")]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 审批状态
    /// </summary>
    [Dict(nameof(StatusApprovalEnum), AllowNullValue=true)]
    [Required(ErrorMessage = "审批状态不能为空")]
    public StatusApprovalEnum? ApprovalAction { get; set; }
    
    /// <summary>
    /// 确认负责人ID
    /// </summary>
    public long? ConfirmerId { get; set; }
    
    /// <summary>
    /// 确认负责人姓名
    /// </summary>
    [MaxLength(64, ErrorMessage = "确认负责人姓名字符长度不能超过64")]
    public string? ConfirmerName { get; set; }

    /// <summary>
    /// 当前审批步骤
    /// </summary>
    public int CurrentStep { get; set; } = 1;

    /// <summary>
    /// 总审批步骤数
    /// </summary>
    public int TotalSteps { get; set; } = 2;

    
}

/// <summary>
/// 审批流程删除输入参数
/// </summary>
public class DeleteStoreProcessFlowStepInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 审批流程更新输入参数
/// </summary>
public class UpdateStoreProcessFlowStepInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 审批类型
    /// </summary>    
    [Required(ErrorMessage = "审批类型不能为空")]
    [MaxLength(255, ErrorMessage = "审批类型字符长度不能超过255")]
    public string FlowType { get; set; }
    
    /// <summary>
    /// 申请批次
    /// </summary>    
    [MaxLength(255, ErrorMessage = "申请批次字符长度不能超过255")]
    public string? BatchNo { get; set; }
    
    /// <summary>
    /// 申请号
    /// </summary>    
    [Required(ErrorMessage = "申请号不能为空")]
    [MaxLength(255, ErrorMessage = "申请号字符长度不能超过255")]
    public string RequestNo { get; set; }
    
    /// <summary>
    /// 分类Id
    /// </summary>    
    public long? StoreTypeId { get; set; }
    
    /// <summary>
    /// 分类名称
    /// </summary>    
    [MaxLength(128, ErrorMessage = "分类名称字符长度不能超过128")]
    public string? StoreTypeName { get; set; }
    
    /// <summary>
    /// 物资Id
    /// </summary>    
    public long? MaterialId { get; set; }
    
    /// <summary>
    /// 物资名称
    /// </summary>    
    [MaxLength(128, ErrorMessage = "物资名称字符长度不能超过128")]
    public string? MaterialName { get; set; }
    
    /// <summary>
    /// 物资单价
    /// </summary>    
    public decimal? MaterialPrice { get; set; }
    
    /// <summary>
    /// 申请数量
    /// </summary>    
    public decimal? Quantity { get; set; }
    
    /// <summary>
    /// 单位
    /// </summary>    
    [MaxLength(32, ErrorMessage = "单位字符长度不能超过32")]
    public string? Unit { get; set; }
    
    /// <summary>
    /// 物资总价
    /// </summary>    
    public decimal? MaterialPriceTotal { get; set; }
    
    /// <summary>
    /// 申请人ID
    /// </summary>    
    public long? ApplicantId { get; set; }
    
    /// <summary>
    /// 申请人姓名
    /// </summary>    
    [MaxLength(255, ErrorMessage = "申请人姓名字符长度不能超过255")]
    public string? ApplicantName { get; set; }
    
    /// <summary>
    /// 申请人区域
    /// </summary>    
    [MaxLength(255, ErrorMessage = "申请人区域字符长度不能超过255")]
    public string? ApplicantDept { get; set; }
    
    /// <summary>
    /// 接收人Id
    /// </summary>    
    public long? ReceiverId { get; set; }
    
    /// <summary>
    /// 接收人姓名
    /// </summary>    
    [MaxLength(255, ErrorMessage = "接收人姓名字符长度不能超过255")]
    public string? ReceiverName { get; set; }
    
    /// <summary>
    /// 接收人区域
    /// </summary>    
    [MaxLength(255, ErrorMessage = "接收人区域字符长度不能超过255")]
    public string? ReceiverDept { get; set; }
    
    /// <summary>
    /// 申请时间
    /// </summary>    
    public DateTime? RequestTime { get; set; }
    
    /// <summary>
    /// 预期时间
    /// </summary>    
    public DateTime? ExpectedDate { get; set; }
    
    /// <summary>
    /// 完成时间
    /// </summary>    
    public DateTime? CompletedTime { get; set; }
    
    /// <summary>
    /// 新增或更新
    /// </summary>    
    [Dict(nameof(StatusNewOrChangeEnum), AllowNullValue=true)]
    public StatusNewOrChangeEnum? StatusNewOrChange { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>    
    [MaxLength(128, ErrorMessage = "备注字符长度不能超过128")]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 审批状态
    /// </summary>    
    [Dict(nameof(StatusApprovalEnum), AllowNullValue=true)]
    public StatusApprovalEnum? ApprovalAction { get; set; }
    
    /// <summary>
    /// 确认负责人ID
    /// </summary>    
    public long? ConfirmerId { get; set; }
    
    /// <summary>
    /// 确认负责人姓名
    /// </summary>    
    [MaxLength(64, ErrorMessage = "确认负责人姓名字符长度不能超过64")]
    public string? ConfirmerName { get; set; }

    /// <summary>
    /// 是否允许系统管理员直接跳至审批环节
    /// </summary>
    public bool? AdminDirectApprove { get; set; }

    /// <summary>
    /// 当前审批步骤
    /// </summary>
    public int CurrentStep { get; set; } = 1;

    /// <summary>
    /// 总审批步骤数
    /// </summary>
    public int TotalSteps { get; set; } = 2;

    
}

/// <summary>
/// 审批流程主键查询输入参数
/// </summary>
public class QueryByIdStoreProcessFlowStepInput : DeleteStoreProcessFlowStepInput
{
}

/// <summary>
/// 撤回已完成操作输入参数
/// </summary>
public class WithdrawCompletedStoreProcessFlowStepInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long Id { get; set; }

    /// <summary>
    /// 撤回原因
    /// </summary>
    [MaxLength(255, ErrorMessage = "撤回原因字符长度不能超过255")]
    public string? Reason { get; set; }
}

/// <summary>
/// 退回审批流程输入参数
/// </summary>
public class ReturnStoreProcessFlowStepInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long Id { get; set; }

    /// <summary>
    /// 退回原因
    /// </summary>
    [MaxLength(255, ErrorMessage = "退回原因字符长度不能超过255")]
    public string? Reason { get; set; }
}
